shell_executor_module.controller('ShellExecutorController',
                          ['$scope', '$window', 'toastr', 'AppUtil','ShellExecutorService',
                           ShellExecutorController]);
function ShellExecutorController($scope, $window, toastr, AppUtil, ShellExecutorService) {
	$scope.commandExecutorBtnDisabled = false;
	$scope.shell_executor = {};
	$scope.executeCommand = function() {
		$scope.submitBtnDisabled = true;
		ShellExecutorService.execute_command($scope.shell_executor).then(function (result) {
			$scope.submitBtnDisabled = false;
            $scope.result = result.body;
        }, function (result) {
        	$scope.submitBtnDisabled = false;
            AppUtil.showErrorMsg(result);
        });
	}
	
}